# -*- coding:utf-8 -*-
# @FileName  :utils.py
# @Time      :2020/10/25 14:59
# @Author    :zhoujirong
# @Desc      : 个人业务日志

import datetime
import parameterized
from biz.flow.per_business_diary import PerBusinessDiaryRequest
from common.log import Log
from biz.cases.base_case import BaseCase
from common.utils import get_redis
from common.params_operator import Param

class TestPerBusinessDiary(BaseCase):
    '''个人业务日志检索'''
    data_file_name = 'per_business_diary.yaml'

    @classmethod
    def setUpClass(cls):
        cls.redis = get_redis()
        cls.cookie = BaseCase().get_token_asyn()

    def test_get_page(self):
        '''个人业务日志查询'''
        curPage = self.file_data.get('curPage')
        maxSize = self.file_data.get('maxSize')
        search_LIKE_userName = self.file_data.get('search_LIKE_userName')
        tmp = '%s - %s'%(datetime.date.today(),datetime.date.today())
        search_GTE_LTE_createTime_DATE_RANGE =tmp
        search_LIKE_actName = self.file_data.get('search_LIKE_actName')
        ret = PerBusinessDiaryRequest.get_page(curPage,maxSize,
                        search_LIKE_userName,
                        search_GTE_LTE_createTime_DATE_RANGE,
                        search_LIKE_actName,self.cookie)
        Log.info(ret)
        self.assertIsNotNone(ret.list)

    @parameterized.parameterized.expand(Param.from_excel('per_business_diary_data.xls'))
    def test_get_page_params(self,curPage,maxSize,
                            search_LIKE_userName,
                            search_LIKE_actName,check,desc):
        self._testMethodDoc = desc
        tmp = '%s - %s' % (datetime.date.today(), datetime.date.today())
        search_GTE_LTE_createTime_DATE_RANGE = tmp
        ret = PerBusinessDiaryRequest.get_page(curPage,maxSize,
                            search_LIKE_userName,
                            search_GTE_LTE_createTime_DATE_RANGE,
                            search_LIKE_actName,self.cookie)
        Log.info(ret)
        self.assertIsNotNone(ret.list)





if __name__ == "__main__":
    pass